sap.ui.define([
   "sap/ui/core/mvc/Controller",
   "sap/m/MessageToast"
], function (Controller, MessageToast) {
   "use strict";
   return Controller.extend("ui5.walkthrough.controller.App", {
      // onInit:function(){
      //     var oData = {
      //         recipient :{
      //             name : "han meimei"
      //         }
      //     }
      //     var oModel = new JSONModel(oData);
      //     this.getView().setModel(oModel);

      //     var i18nModel = new ResourceModel({
      //         bundleName:"sap.ui.demo.walkthrough.i18n.i18n"
      //     })
      //     this.getView().setModel(i18nModel,"i18n1");

      // },
      onInit() {
         this.getView().addStyleClass(this.getOwnerComponent().getContentDensityClass());
      },
      onSayHelloButtonPress: function (oEvent) {
         // show a native JavaScript alert
         //   alert("Hello World");
         var oBuldle = this.getView().getModel("i18n").getResourceBundle();
         var sRecipient = this.getView().getModel().getProperty("/recipient/name");
         var sMsg = oBuldle.getText("helloMsg", [sRecipient]);

         MessageToast.show(sMsg);
      },
      onPageNavButtonPress: function (oEvent) {

      }
   });
});
